package com.jeff.tianti.cms.dao;

import com.jeff.tianti.common.dao.CustomBaseSqlDaoImpl;
import com.jeff.tianti.common.entity.PageModel;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.jeff.tianti.cms.entity.CnaaFlow;
import com.jeff.tianti.cms.dto.CnaaFlowQueryDTO;

/**
 * @author xujianfang
 * @desc CnaaFlowDaoImpl��
 * @date 2019-07-12
 */

public class CnaaFlowDaoImpl extends CustomBaseSqlDaoImpl implements CnaaFlowDaoCustom {

    public PageModel<CnaaFlow> queryCnaaFlowPage(CnaaFlowQueryDTO cnaaFlowQueryDTO) {
        Map<String, Object> map = new HashMap<String, Object>();
        StringBuilder hql = new StringBuilder();
        hql.append("select t from CnaaFlow t ");
        return this.queryForPageWithParams(hql.toString(), map, cnaaFlowQueryDTO.getCurrentPage(), cnaaFlowQueryDTO.getPageSize());
    }

    public List<CnaaFlow> queryCnaaFlowList(CnaaFlowQueryDTO cnaaFlowQueryDTO) {
        Map<String, Object> map = new HashMap<String, Object>();
        StringBuilder hql = new StringBuilder();
        hql.append("select t from CnaaFlow t where t.deleteFlag = 0 order by t.level ");
        return this.queryByMapParams(hql.toString(), map);
    }


}